{{ define "content" -}}

  <article class="post bg-white">
    <!-- post-header -->
    <header class="post-header">
      <h1 class="post-title">{{ .Title }}</h1>
      {{ partial "post/i18nlist.html" . }}
      <div class="post-meta">
        <time datetime="{{ .Date.Format "2006-01-02" }}" class="post-time">
          {{ .Date.Format (.Site.Params.dateFormatToUse | default "2006-01-02") }}
        </time>
        {{ with .Params.categories -}}
          <div class="post-category">
            {{ range . }}
            {{- $name := . -}}
            {{- with $.Site.GetPage "taxonomy" (printf "categories/%s" $name) | default ($.Site.GetPage "taxonomy" (printf "categories/%s" ($name | urlize))) -}}
              <a href="{{ .Permalink }}"> {{ $name }} </a>
            {{ end -}}
            {{ end }}
          </div>
        {{- end }}
        {{ if .Site.Params.moreMeta -}}
          <span class="more-meta"> {{ i18n "wordCount" .WordCount }} </span>
          <span class="more-meta"> {{ i18n "readingTime" .ReadingTime }} </span>
        {{- end }}

        <!-- Counter busuanzi -->
        {{ if .Site.Params.counter.busuanzi.enable }}
          <span id="busuanzi_container_page_pv">
            | 阅读 <span id="busuanzi_value_page_pv"></span>
          </span>
        {{ end }}

        <!-- Counter leancloud -->
        {{ if .Site.Params.counter.leancloud.enable }}
          <span id="{{ .RelPermalink }}" class="leancloud_visitors" data-flag-title="{{ .Title }}">
            <span class="post-meta-item-text"> | 阅读 </span>
            <span class="leancloud-visitors-count"></span>
          </span>
        {{ end }}
      </div>
    </header>

    <!-- TOC -->
    {{ partial "post/toc.html" . }}

    <!-- Content -->
    <div class="post-content">
      {{ .Content }}
    </div>

    <!-- Copyright -->
    {{ partial "post/copyright.html" . }}

    <!-- Reward -->
    {{ partial "post/reward.html" . }}

    <footer class="post-footer">
      {{ with .Params.tags -}}
        <div class="post-tags">
          {{ range . }}
          {{- $name := . -}}
          {{- with $.Site.GetPage "taxonomy" (printf "tags/%s" $name) | default ($.Site.GetPage "taxonomy" (printf "tags/%s" ($name | urlize))) -}}
          <a href="{{ .Permalink }}">{{ $name }}</a>
          {{ end -}}
          {{ end }}
        </div>
      {{- end }}

      <!-- Post Pagination -->
      <nav class="post-nav">
        {{ with .NextInSection }}
          <a class="prev" href="{{ .RelPermalink }}">
            {{/* icon left */}}
            <i class="iconfont">
              {{ partial "svg/left.svg" }}
            </i>
            <span class="prev-text nav-default">{{ .Title }}</span>
            <span class="prev-text nav-mobile">{{ i18n "prev_post" }}</span>
          </a>
        {{- end }}
        {{ with .PrevInSection }}
          <a class="next" href="{{ .RelPermalink }}">
            <span class="next-text nav-default">{{ .Title }}</span>
            <span class="prev-text nav-mobile">{{ i18n "next_post" }}</span>
            {{/* icon right */}}
            <i class="iconfont">
              {{ partial "svg/right.svg" }}
            </i>
          </a>
        {{- end }}
      </nav>
    </footer>
  </article>

  <!-- Author Info -->
  {{ if and (.Params.author | default .Site.Author.name) (.Params.showAuthorInfo | default .Site.Params.showAuthorInfo) }}
  {{ partial "author_info.html" (dict "author" (.Params.author | default .Site.Author.name) "context" $) }}
  {{ end }}

  <!-- Comments -->
  {{ partial "comments.html" . }}
{{- end }}
